(function () {
    'use strict';
    var global$7 = tinymce.util.Tools.resolve('tinymce.PluginManager');
    var setupMenuItems = function (editor) {
        editor.ui.registry.addMenuItem('childTd', {
            text: 'childTd',
            icon: 'new-tab',
            onAction: function (){
                var tdObject = editor.dom.getParent(editor.selection.getStart(), "td");
                editor.execCallback('childTdCallBack', editor,tdObject);
                editor.undoManager.add();
            }
        });
        editor.ui.registry.addMenuItem('removeChildTd', {
            icon: 'unlink',
            text: 'removeChildTd',
            onAction: function () {
                var tdObject = editor.dom.getParent(editor.selection.getStart(), "td");
                editor.execCallback('remvoeChildTdCallBack', editor,tdObject);
            },
        });
    };
    var setupContextMenu = function (editor) {
        var inLink = 'childTd removeChildTd';
        editor.ui.registry.addContextMenu('childTd', {
            update: function (element) {
                var tdObject = editor.dom.getParent(editor.selection.getStart(), "td");
                if(!tdObject) return "";
                if(tdObject.className && tdObject.className.indexOf("childTd") != -1) return "removeChildTd";
               // return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink;
                return "childTd";
            }
        });
    };
    function Plugin () {
        global$7.add('childTd', function (editor) {
            setupMenuItems(editor);
            setupContextMenu(editor);
        });
    }

    Plugin();
}());